home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / rpg / crossfir.000 / crossfir / crossfire-0.92.4.client / client.h < prev    next >
C/C++ Source or Header  |  1996-04-21  |  5KB  |  143 lines

  1. /* Header file for new client. */
  2.  
  3. #include <cconfig.h>
  4. #include <includes.h>
  5. #include <newclient.h>
  6. #include <item.h>
  7. #include <arglist.h>
  8.  
  9. #include <proto.h>
  10.  
  11. /* Just some handy ones I like to use */
  12. #ifndef FALSE
  13. #define FALSE 0
  14. #endif
  15. #ifndef TRUE
  16. #define TRUE 1
  17. #endif
  18.  
  19. #define ECLIENT_VERSION 1002
  20. #define STRINGCOMMAND 0
  21. #define MAX_BUF 256
  22.  
  23.  
  24. /* Some global variables */
  25. extern TcpSocket conns[2];
  26.  
  27. extern int port_num,
  28.     basenrofpixmaps;    /* needed so that we know where to
  29.                  * start when creating the additional
  30.                  * images in x11.c
  31.                  */
  32.  
  33. extern int fdin,fdout,        /* file descriptors for the socket */
  34.     pending_images,        /* number of images we have requested
  35.                  * but not received.
  36.                  */
  37.     pending_archs,        /* Same as pending images, but
  38.                  * archetypes instead
  39.                  */
  40.     maxfiledescriptor;        /* Max file descriptor allowed for the
  41.                  * system.  Used for the select calls.
  42.                  */
  43.  
  44. extern char
  45.     *server, *client_libdir,
  46.     *client_archfile,        /* Name (full path) of the file
  47.                  * that stores local client
  48.                  * archetypes.  New ones that are
  49.                  * downloaded will also be stored in this
  50.                  * file
  51.                  */
  52.     init_load_image,        /* If true, download all images from
  53.                  * server at startup
  54.                  */
  55.     init_load_arch,        /* As per init_load_image, but for
  56.                  * archetypes
  57.                  */
  58.     save_new_data;        /* IF true, then when we get new image
  59.                  * or archetype data, we save it to
  60.                  * disk, so that we don't have to
  61.                  * download it each time.
  62.                  */
  63.  
  64. typedef enum Input_State {Playing, Reply_One, Reply_Many,
  65.     Configure_Keys, Command_Mode} Input_State;
  66.  
  67. typedef enum inventory_show {
  68.   show_all = 0, show_applied = 1, show_unapplied = 2, show_unpaid = 3,
  69.   show_cursed = 4, show_magical = 5, show_nonmagical = 6
  70. } inventory_show;
  71.  
  72. typedef enum rangetype {
  73.   range_bottom = -1, range_none = 0, range_bow = 1, range_magic = 2,
  74.   range_wand = 3, range_rod = 4, range_scroll = 5, range_horn = 6,
  75.   range_steal = 7,
  76.   range_size = 8
  77. } rangetype;
  78.  
  79. typedef struct Stat_struct {
  80.   sint8 Str,Dex,Con,Wis,Cha,Int,Pow;
  81.   sint8 wc,ac;    /* Weapon Class and Armour Class */
  82.   sint8 armor;
  83.   sint8 level;
  84.   sint16 hp;      /* Hit Points. */
  85.   sint16 maxhp;
  86.   sint16 sp;      /* Spell points.  Used to cast spells. */
  87.   sint16 maxsp;   /* Max spell points. */
  88.   sint16 grace;      /* Spell points.  Used to cast spells. */
  89.   sint16 maxgrace;   /* Max spell points. */
  90.   sint32 exp;      /* Experience.  Killers gain 1/10. */
  91.   sint16 food;    /* How much food in stomach.  0 = starved. */
  92.   sint8 dam;      /* How much damage this object does when hitting */
  93.   sint32 speed;    /* Gets converted to a float for display*/
  94.   sint32 weapon_sp;    /* Gets converted to a float for display */
  95. } Stats;
  96.  
  97.  
  98. typedef struct Player_Struct {
  99.     item    *ob;        /* Player object */
  100.     item    *below;        /* Items below the player (pl.below->inv) */
  101.     inventory_show show_what;    /* What to show in inventory */
  102.     item    *container;    /* open container */
  103.     uint16    count_left;    /* count for commands */
  104.     Input_State input_state;    /* What the input state is */
  105.     uint32    no_echo:1;    /* If TRUE, don't echo keystrokes */
  106.     char    input_text[MAX_BUF];    /* keys typed (for long commands) */
  107.     char    name[40];    /* name and password.  Only used while */
  108.     char    password[40];    /* logging in. */
  109.     rangetype    shoottype;    /* What type of range attack player has */
  110.     item    *ranges[range_size];    /* Object that is used for that */
  111.                 /* range type */
  112.     uint8    ready_spell;    /* Index to spell that is readied */
  113.     char    spells[255][40];    /* List of all the spells the */
  114.                 /* player knows */
  115.     uint8    map_x, map_y;    /* These are offset values.  See object.c */
  116.                 /* for more details */
  117.     Stats    stats;        /* Player stats */
  118.     char    title[MAX_BUF];    /* Title of character */
  119.     char    range[MAX_BUF];    /* Range attack chosen */
  120.     uint32    fire_on:1;    /* True if fire key is pressed */
  121.     uint32    run_on:1;    /* True if run key is on */
  122.     uint32    echo_bindings:1;/* If true, echo the command that the key */
  123.                 /* is bound to */
  124.     uint32    count;        /* Repeat count on command */
  125.  
  126. } Client_Player;
  127.  
  128. extern Client_Player cpl;        /* Player object. */
  129.  
  130. /* To handle XPM display mode, #ifdef Xpm_Pix are only used in areas
  131.  * that make XPM function calls, or areas where using certain display
  132.  * methods is a lot more efficient.
  133.  *
  134.  * Xpm_Display can only be set if Xpm_Pix is defined.  Thus, a lot
  135.  * of the #ifdefs can be removed - those functions will never be called,
  136.  * or values used, because Display_Mode will never be set to Xpm_Display
  137.  */
  138.  
  139. typedef enum Display_Mode {Font_Display, Pix_Display, Xpm_Display}
  140.     Display_Mode;
  141.  
  142. extern Display_Mode display_mode;
  143.